Mouse Input


Mouse input is accepted on all platforms (on mobile devices it is accepted as a single touch. If you need to use multi-touch, you should be using the device specific functions) and has a number of constants that are used to specify the buttons being pressed. These constants are shown in the following table:

Constant Description
mb_left The left mouse button
mb_middle The middle mouse button (this may not be valid for all target platforms)
mb_right The right mouse button
mb_none No mouse button
mb_any Any of the mouse buttons


The following functions exist for the standard mouse button controls:

  1. mouse_button
  2. mouse_check_button
  3. mouse_check_button_pressed
  4. mouse_check_button_released
  5. mouse_clear
  6. mouse_last_button
  7. mouse_wheel_up
  8. mouse_wheel_down
  9. mouse_x
  10. mouse_y

Note that there are also a set of window functions related to using the mouse on desktop targets:

  1. window_mouse_get_x
  2. window_mouse_get_y
  3. window_mouse_set
  4. window_view_mouse_get_x
  5. window_view_mouse_get_y
  6. window_views_mouse_get_x
  7. window_views_mouse_get_y